<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="button" value="按钮" onclick="f5()">

<script>
    //1 无参无返回值
    function f1() {
        console.log("f1")
    }
    //调用
    f1();
    //2 有参无返回值
    function f2(name,age) {
        console.log(name+age);
    }
    f2("雪碧",1)

    //3 无参有返回值
    function f3() {
        return "蛋蛋"
    }
    let a  = f3();
    console.log(a);

    //4 有参有返回值
    function f4(x,y) {
        return x*y;
    }
    let z = f4(5,7);
    console.log(z)

    let  f5 = function (name ,age) {
        console.log(name+":"+age)
    }
    f5("雪碧",1)

    let f6 = new Function("name","age","console.log(name+':'+age)");
    f6("雪碧",1)
</script>
</body>
</html>